package com.example.springboot14.controller;

import com.example.springboot14.config.ErpInfo;
import com.example.springboot14.config.ErpInfo2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

// localhost:8080/zg/prop2
// localhost:8080/zg/prop3
@RestController
public class BeanPropController {
    @Autowired
    ErpInfo erpInfo;
    @ Autowired
    ErpInfo2 erpInfo2;
    @RequestMapping("/prop2")
    public String prop2(){
        return erpInfo.getErpurl()+erpInfo.getUsername();
    }

   
    @ RequestMapping("/prop3")
    public Map<String, String> prop3(){
        Map<String, String> result=new HashMap<String, String>();
        result.put("erpurl",erpInfo2.getErpurl());
        result.put("username",erpInfo2.getUsername());
        result.put("password",erpInfo2.getPwd());
        return result;
    }

}
